<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{  
	public static function autoload($class) 
	{
		include str_replace('_', '/', $class) . '.php';
		return $class;
	}
	
    /**
     * Fonction de chargement
     */
	protected function _initAutoload()
	{
		//on configure le module par d�faut avec son namespace, son chemin et les ressources associ�es
		$moduleLoader = new Zend_Application_Module_Autoloader(array(
		'namespace' => 'Default_',
		'basePath' => APPLICATION_PATH . '/modules/default'));
		$moduleLoader->addResourceType('Models', 'models', 'Models');
		$moduleLoader->addResourceType('Forms', 'forms', 'Forms');
		Zend_Session::start(); 
        return $moduleLoader;
	}
	
	/**
	 * Fonction servant � initialiser la vue
	 */
	protected function _initView()
    {
        // Initialize view
        $view = new Zend_View();
        $view->doctype('XHTML1_STRICT');
        $view->headMeta()->appendHttpEquiv('Content-Type',
                                           'text/html; charset=utf-8');
        $view->addHelperPath('App/View/Helper/', 'App_View_Helper');
        Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
        // Add it to the ViewRenderer
        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
        $viewRenderer->setView($view);
        //ZendX_JQuery_View_Helper_JQuery::enableNoConflictMode();
        // Return it, so that it can be stored by the bootstrap
        return $view;
    } 
    
    protected function _initModifiedFrontController()
	{
		$this->bootstrap('FrontController');
		$front = $this->getResource('FrontController');
		$response = new Zend_Controller_Response_Http;
		$response->setHeader('Content-Type','text/html; charset=UTF-8', true);
		$front->setResponse($response);
	}
	
}

